import request from '@/utils/request.js'
const PATH = '/admin/banner'

// 添加轮播图
export const addBanner = (data) => {
  return request.post(PATH, {
    bannerList: data
  })
}

// 分页查询轮播图
export const getBannerList = ({ page, pageSize }) =>
  request.get(PATH, {
    params: {
      page,
      pageSize
    }
  })

// 删除轮播图
export const delBanner = ({ id, url }) =>
  request.delete(PATH + `/${id}`, {
    params: {
      url
    }
  })

// 修改状态
export const updateStatus = ({ id, status }) =>
  request.put(PATH + `/${id}/${status}`)
